<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    ?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>
<div class="container">
<h3>员工入职办理</h3>
<table>
    <tr>
        <td><label>姓名:</label><?php echo $user['real_name'],'-',$user['user_code'];?></td>
        <td><label>英文名:</label><?php echo $user['english_name'];?></td>
        <td><label>城市:</label><?php echo $user['city_name'];?></td>
        <td><label>部门:</label><?php echo $user['department_name'];?></td>
        <td style="width: 130px;white-space: nowrap;" title="<?php echo $user['job_name'];?>"><label>职位:</label><?php echo $user['job_name'];?></td>
        <td><label>直属主管:</label><?php echo $user['parent_name'];?>(电话:<?php echo $user['parent_phone'];?>)</td>
    </tr>
</table>
<form action="#" id="form1" method="post">
    <div class="p0">
        <span>行政</span>
        <ul>
            <li style="width: 210px">
                <label>电脑：</label>
                <select style="width: 104px;<?php if(isset($error['computer'])){echo 'border-color: red;';}?>" name="computer" <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>>
                <option value=''>请选择</option>
                <?php foreach($computer as $in=>$co){?>
                        <option value="<?php echo $in;?>" <?php if($in == $user['computer']){?>selected="selected"<?php }?>><?php echo $co;?></option>
                <?php }?>
                </select>
            </li>
            <li style="width: 244px;">
                <label>办公地点：</label>
                <select style="width: 160px;padding-right: 0;<?php if(isset($error['work_space'])){echo 'border-color: red;';}?>" name="work_space" <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>>
                <option value="">请选择</option>
                <?php foreach($work_space as $in=>$co){?>
                        <option value="<?php echo $in;?>" <?php if($in == $user['work_space']){?>selected="selected"<?php }?>><?php echo $co;?></option>
                <?php }?>
                </select>
            </li>
            <li>
                <label>座位：</label>
                <input style="width: 100px;<?php if(isset($error['seat'])){echo 'border-color: red;';}?>" type="text" name="seat" value="<?php echo $user['seat'];?>"  <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>/>
            </li>
            <li style="width: 210px;margin-top: 8px;">
                <label>电脑编号：</label>
                <input style="width: 96px;<?php if(isset($error['computer_code'])){echo 'border-color: red;';}?>" type="text" name="computer_code" value="<?php echo $user['computer_code'];?>" <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>/>
            </li>
            <li style="width: 307px;margin-top: 8px;">
                <label style="">分机号：</label>
                <input style="width: 84px;" type="text" name="office_phone" value="<?php echo $user['office_phone'];?>"  <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>/> - <input style="width: 50px" type="text" name="office_phone_ex" value="<?php echo $user['office_phone_ex']?$user['office_phone_ex']:'';?>"  <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>/>
            </li>
            <li style="padding-top: 12px;">
                <input type="checkbox" name="is_instal" <?php if($user['is_instal']) {?>checked<?php }?>  <?php if(!isset($role['xz'])){echo 'disabled="false"';}?>/>
                <label>新增电话</label>
            </li>
        </ul>
    </div>
    <div class="p0">
        <span style="line-height: 27px;height: 40px;">IT</span>
        <ul>
            <li>
                <label>域帐号：</label>
                <input type="text" style="width: 135px;<?php if(isset($error['domain_account'])){echo 'border-color: red;';}?>" name="domain_account" value="<?php echo $user['domain_account'];?>" <?php if(!isset($role['it'])){echo 'disabled="false"';}?>/>
            </li>
            <li>
                <label>邮箱：</label>
                <input type="text" style="width: 153px;<?php if(isset($error['office_mail'])){echo 'border-color: red;';}?>" name="office_mail" value="<?php echo $user['office_mail'];?>" <?php if(!isset($role['it'])){echo 'disabled="false"';}?>/>
            </li>
            <!-- li style="margin-left:15px;">
                <label>CRM帐号：</label>
                <input type="text" style="width: 135px;<?php if(isset($error['crm_account'])){echo 'border-color: red;';}?>" name="crm_account" value="<?php echo $user['crm_account'];?>" <?php if(!isset($role['it'])){echo 'disabled="false"';}?>/>
            </li-->
        </ul>
    </div>
    <div class="p0">
        <span style="line-height: 27px;">HR</span>
        <ul>
            <li style="float:none;width: 260px;">
                <label style="width: 100px;">确认入职时间：</label>
                <input class="datepicker" type="text" name="re_entry_date" value="<?php echo $user['re_entry_date'];?>" <?php if(!isset($role['hr']) || isset($operated['hr']) ){echo 'disabled="false"';}?>/>
            </li>
        </ul>
    </div>
    <hr style="border:1px dashed #CCCCCC;"/>
    <?php if($user['is_entry'] == Const_Flow::ENTRY_CANCEL){?>
    <div class="p0">
        <span style="line-height: 27px;height: 40px;color:red;width:240px;">HR取消入职！</span>
    </div>
    <div class="p0">
        <span style="line-height: 27px;height: 40px;">IT</span>
        <ul>
            <li style="float:none;width: 260px;">
                <input type="checkbox" onchange="change_color('is_close_right')" name="is_close_right" <?php if(!isset($role['qx_it'])){?>disabled="false"<?php }?> <?php if($user['is_close_right'] || isset($role['qx_it'])){?>checked<?php }?> >
                <label id="label_is_close_right" style="width: 100px;text-align:left;<?php if(isset($error['is_close_right'])){echo 'color: red;';}?>">确认关闭权限</label>
            </li>
        </ul>
    </div>
    <div class="p0">
        <span style="line-height: 27px;height: 40px;">行政</span>
        <ul>
            <li style="float:none;width: 360px;">
                <input type="checkbox" onchange="change_color('is_back_computer')" name="is_back_computer" <?php if(!isset($role['qx_xz'])){?>disabled="false"<?php }?> <?php if($user['is_back_computer'] || isset($role['qx_xz'])){?>checked<?php }?> >
                <label id="label_is_back_computer" style="width: 100px;text-align:left;<?php if(isset($error['is_back_computer'])){echo 'color: red;';}?>">确认收回电脑</label>
                <input type="checkbox" name="is_back_phone" <?php if(!isset($role['qx_xz'])){?>disabled="false"<?php }?> <?php if($user['is_back_phone'] || (isset($role['qx_xz'])&&$user['office_phone'])){?>checked<?php }?>>
                <label style="width: 200px;text-align:left;">确认收回电话/电话端口</label>
            </li>
        </ul>
    </div>
    <?php }?>
    <div class="p0 p3">
        <?php if(!isset($operated['end'])){?>
        <input type="hidden" name="entry_id" value="<?php echo $user['entry_id'];?>"/>
        <input type="hidden" name="Submit" value=""/>
        <?php if(isset($role['xz']) || isset($role['it']) || isset($role['qx_it']) || isset($role['qx_xz'])){?>
            <?php if(!isset($operated['xz']) || !isset($operated['xz'])){?>
             <input type="submit" id="btnSubmit" class="button" value="提&nbsp;&nbsp;交" v="3"/>
            <?php }?>
        <?php } if(isset($role['hr'])){?>
            <?php if(!isset($operated['hr'])){?>
            <input type="button" class="button" value="确认入职" v="1"/>
            <?php }?>
            <input type="button" class="button" value="取消入职" v="2"/>
        <?php }}?>
        <?php if(isset($operated['end']) && isset($role_list[Const_Flow::ROLE_HR])){?>
        <a href="<?=Flow_Urls::flow_print().'?do=staff&id='.$user['entry_id']?>" target="_blank" class="button">打印预览</a>
        <?php }?>
    </div>
</form>
<div class="footer">
</div>
    <?php $this->script_block_begin(); ?>
<script type="text/javascript">
    function change_color(name){
        if($("input[type='checkbox'][name='"+name+"']").attr("checked")==undefined){
            $("#label_"+name).css("color","red");
        }else{
            $("#label_"+name).css("color","#333333");
        }
    }
</script>


    <?php $this->script_block_end(); ?>